import { lazy } from "react";
import {Navigate} from "react-router-dom"

const Home=lazy(()=>import(('../pages/Home/Home')))
const List=lazy(()=>import(('../pages/List/List')))
const Data1=lazy(()=>import(('../pages/Data1/Data1')))
const Data2=lazy(()=>import(('../pages/Data2/Data2')))
const Mages=lazy(()=>import(('../pages/mages/mages')))

export const routes=([
    {
        path:'/mages/home',
        element:<Home></Home>
    },
    {
        path:'/mages/list',
        element:<List></List>
    },
    {
        path:'/mages/data1',
        element:<Data1></Data1>
    },
    {
        path:'/mages/data2',
        element:<Data2></Data2>
    },
])

const listData = [
    {
        path:'',
        element:<Navigate to={'/mages'}></Navigate>
    },
    {
        path:'/mages',
        element:<Mages></Mages>,
        children:routes
    }
]
export default listData